package com.itheima.jdk8_DateDemo;

import java.time.Duration;
import java.time.LocalDateTime;

public class Test8 {
    public static void main(String[] args) {
        LocalDateTime localDateTime1 = LocalDateTime.of(2020, 12, 20, 13, 21, 54);
        LocalDateTime localDateTime2 = LocalDateTime.of(2021, 12, 29, 11, 25, 35);

        Duration duration = Duration.between(localDateTime1, localDateTime2);

        System.out.println(duration.toSeconds());
        System.out.println(duration.toHours());
        System.out.println(duration.toMinutes());
        System.out.println(duration.toDays());
    }
}
